#ifndef _CMENUITEM_H_
#define _CMENUITEM_H_

//Item index
#define k_Item_Anim_Normal		0
#define k_Item_Anim_Hover		1
#define k_Item_Anim_Select		2
#define k_Item_Anim_Disable		3
#define k_Item_Anim_Font		4
#define k_Item_Anim_Max			5

#define k_Item_Command_Value	0
#define k_Item_Command_None		-1
#define k_Item_Command_Wait		-2

class CAnimObject;
class GLESLib;

class CMenuItem
{
	INT16 iX, iY;
	INT16 iCommand;

	CAnimObject* pAnim;
	UINT8 iCurrentAnim;
	UINT8 pAnims[k_Item_Anim_Max];
	bool bUseFontPal;
	bool bVisible;

public:
	CMenuItem(INT16 cmd, int x, int y, CAnimObject* anim = NULL, bool isFont = false, UINT8* aIds = NULL, UINT8 fanim = 0);
	~CMenuItem();
	//bool HandlePoiter(int px, int py);
	bool IsPointerHit(int px, int py);
	void SetEnable(bool enable = true);
	bool IsEnable();	
	void SetVisible(bool show = true);
	bool IsVisible();
	void SetPos(int x, int y);
	void SetState(int state);
	void GetPos(POINT *p);
	void Move(int dx, int dy);	
	void ModifyStateAnim(int state, UINT8 anim, bool setAnim = false);
	void ModifyStateAnims(UINT8* anims);
	UINT8 GetAnimIndex(int state);
	INT16 GetCommand();
	INT16 Update();
	void Draw(GLESLib *g);
};

#endif // _CMENUITEM_H_